//
//  Utils.h
//  BBT
//
//  Created by monkxp on 15/8/24.
//  Copyright (c) 2015年 QCKJ. All rights reserved.
//

#import <Foundation/Foundation.h>


#define CC_MD5_DIGEST_LENGTH 32
@interface Utils : NSObject
+(void) saveDataToFile:(NSDictionary *)data category:(NSString *) category;
+(NSDictionary *) loadDataFromFile:(NSString *) category;
void registerJPush(NSDictionary *launchOptions);
+ (NSString *)md5:(NSString *)str;

//+(MWGridCell *) MWCellWithFrame:(CGRect) frame url:(NSString *)url;

+(NSString*)id2str:(id)obj;
+(BOOL)id2bool:(id)obj;
+(int) id2int:(id) obj;
+(float) id2float:(id) obj;


+(void)closeHud;
+(void)showHudWithTitle:(NSString*)title  target:(UIViewController *)target;
+(void)showHudWithTitle:(NSString*)title delay:(float)seconds target:(UIViewController *)target;
+(void)showHudWithTitle:(NSString*)title delay:(float)seconds completionBlock:(dispatch_block_t)block;
+(void)alertControllerWithTitle:(NSString *)title
                        message:(NSString *)message
                         target:(UIViewController *)target
                 preferredStyle:(UIAlertControllerStyle)preferredStyle
                actionWithTitle:(NSString *)title1
                          style:(UIAlertActionStyle)style1
                        handler:(dispatch_block_t)handler1
                actionWithTitle:(NSString *)title2
                          style:(UIAlertActionStyle)style2
                        handler:(dispatch_block_t)handler2
                     completion:(dispatch_block_t)completion;
+(NSString *)countNumAndChangeformat:(NSString *)inNum;
+(UIImage *)scaleToSize:(UIImage *)img size:(CGSize)size;
+(UIImage *)reduceImage:(UIImage *)image percent:(float)percent;
+(BOOL)validateIDCardNumber:(NSString *)value;
+(NSString *)fixPhoneNo:(NSString *)phoneNo;
+(BOOL)validateMobile:(NSString *)mobileNum;
+(NSString *) platform;
+(BOOL) checkLocationServiceEnable;
+(UIImage*)compressImage:(UIImage *)image toMaxFileSize:(NSInteger)maxFileSize;
+(UIImage*)imageWithSize:(UIImage*)image scaledToSize:(CGSize)newSize;

/**
 * 把动态类型 转为  json   字符串
 */
+(NSString *)changeTypeWithJson:(id)obj;

//+(BOOL)valiMobile:(NSString *)mobile;

//时间戳转成时间
+ (NSString *)timeWithTimeIntervalString:(NSString *)timeString;

@end
